<?php

namespace app\api\model;

use app\admin\model\ServersUser;
use app\admin\model\SystemConfig;
use think\Model;
use think\model\concern\SoftDelete;

/**
 * 商品列表
 */
class AfterOrder extends Model
{
    // protected static function base($query)
    // {
    //     $query->where('status',1);
    // }

    // protected $name='mall_goods';

    // 开启自动写入时间戳字段
    protected $auto_timestamp = 'false';
    // 设置json类型字段
	// protected $json = ['sf'];
    protected $append = ['boot', 'is_after'];
      // 追加属性

      use SoftDelete;

      protected $deleteTime = 'delete_time';

      public function getIsAfterAttr($value, $data) {
          return true;
      }

      public function getBootAttr($value, $data){
        $attachOrder = new AttachOrder();
        return $attachOrder->where('oid', $data['id'])->where('type', 2)->field('id,money,status,desc,oid')->select();
    }

      
}
